/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2024-02-07
 * Time: 9:30
 */
public class Sort {
    // 选择排序
public static void selectSort(int[] array){
    for (int i = 0; i < array.length-1; i++) {
        int tmp=i;
        for (int j = i+1; j < array.length; j++) {
            if(array[j]<array[tmp]){
                tmp=j;
            }
        }
        swap(array,tmp,i);
    }

    }
    public static void swap(int[] array,int i,int j) {
    int m=array[i];
    array[i]=array[j];
    array[j]=m;
    }

}
